<?php
namespace Model;

use Zend\Db\Adapter\Adapter;
use Zend\Db\Sql\Predicate\Like;
use Zend\Db\Sql\Predicate\Operator;
use Zend\Db\Sql\Select;
use Zend\InputFilter\InputFilter;

class TemplateTable extends AbstractTable implements LanguageAwareInterface
{

    /**
     * @var string
     */
    private $_lang;
    /**
     * @param $id
     * @return Template
     */
    public function getTemplate($id){
       return $this->getById($id);
    }

    /**
     * @param $name
     * @return Template
     */
    public function getTemplateByName($name)
    {
       return $this->getByColumn('name', $name)->current();
    }


    public function getLang()
    {
        return $this->_lang;
    }

    public function setLang($lang)
    {
       $this->_lang = $lang;
    }

    public function getAll(){
        return $this->getTableGateway()->select(array('lang'=>$this->_lang));
    }
}